import { instance } from "./api.interceptor"
import { ICreateLesson, ILesson, IUpdateLesson } from "../interfaces"


export const CompletedTaskService = {

    async create(dto: { lessonId: number }) {
        const resp = await instance.post('/completed-task', dto)
        return resp.data
    },
    async lessonCompletionCheck(lessonId: number) {
        const resp = await instance.get(`/completed-task/lesson-completion-check/${lessonId}`)
        return resp.data
    },
    async themeCompletionCheck(themeId: number) {
        const resp = await instance.get(`/completed-task/theme-completion-check/${themeId}`)
        return resp.data
    },

    async disciplineCompletionCheck(lessonId: number) {
        const resp = await instance.get(`/completed-task/discipline-completion-check/${lessonId}`)
        return resp.data
    },

    async findAllByUser(): Promise<{ 
        completedLessons: number[],
        completedThemes: number[] 
        completedDisciplines: number[] 
    }> {
        const resp = await instance.get(`/completed-task/`)
        return resp.data
    },




}
